151 XMC_BCCU_STATUS_SUCCESS = 0U,
152 XMC_BCCU_STATUS_ERROR = 1U,
159 XMC_BCCU_BCLK_MODE_NORMAL = 0U,
160 XMC_BCCU_BCLK_MODE_FAST = 1U,
161 } XMC_BCCU_BCLK_MODE_t;
167 XMC_BCCU_TRIGMODE0 = 0U,
168 XMC_BCCU_TRIGMODE1 = 1U,
169 } XMC_BCCU_TRIGMODE_t;
175 XMC_BCCU_TRIGDELAY_NO_DELAY = 0U,
176 XMC_BCCU_TRIGDELAY_QUARTER_BIT = 1U,
177 XMC_BCCU_TRIGDELAY_HALF_BIT = 2U,
178 } XMC_BCCU_TRIGDELAY_t;
184 XMC_BCCU_SUSPEND_MODE_IGNORE = 0U,
185 XMC_BCCU_SUSPEND_MODE_FREEZE = 1U,
187 XMC_BCCU_SUSPEND_MODE_SAFE_FREEZE = 2U,
189 } XMC_BCCU_SUSPEND_MODE_t;
195 XMC_BCCU_TRAPEDGE_RISING = 0U,
196 XMC_BCCU_TRAPEDGE_FALLING = 1U,
197 } XMC_BCCU_TRAPEDGE_t;
204 XMC_BCCU_EVENT_TRIGGER0 = 0x1U,
205 XMC_BCCU_EVENT_TRIGGER1 = 0x2U,
206 XMC_BCCU_EVENT_FIFOFULL = 0x4U,
207 XMC_BCCU_EVENT_FIFOEMPTY = 0x8U,
208 XMC_BCCU_EVENT_TRAP = 0x10U,
216 XMC_BCCU_EVENT_STATUS_TRIGGER0 = 0x1U,
217 XMC_BCCU_EVENT_STATUS_TRIGGER1 = 0x2U,
218 XMC_BCCU_EVENT_STATUS_FIFOFULL = 0x4U,
219 XMC_BCCU_EVENT_STATUS_FIFOEMPTY = 0x8U,
220 XMC_BCCU_EVENT_STATUS_TRAP = 0x10U,
221 XMC_BCCU_EVENT_STATUS_TRAP_STATE = 0x40U,
222 } XMC_BCCU_EVENT_STATUS_t;
228 XMC_BCCU_TRAP_STATUS_DEACTIVE = 0x0U,
229 XMC_BCCU_TRAP_STATUS_ACTIVE = 0x1U,
230 } XMC_BCCU_TRAP_STATUS_t;
236 XMC_BCCU_TRAP_LEVEL_LOW = 0x0U,
237 XMC_BCCU_TRAP_LEVEL_HIGH = 0x1U,
238 } XMC_BCCU_TRAP_LEVEL_t;
244 XMC_BCCU_CH_FLICKER_WD_DS = 0U,
245 XMC_BCCU_CH_FLICKER_WD_EN = 1U,
246 } XMC_BCCU_CH_FLICKER_WD_t;
252 XMC_BCCU_CH_GATING_FUNC_DISABLE = 0U,
253 XMC_BCCU_CH_GATING_FUNC_ENABLE = 1U,
254 } XMC_BCCU_CH_GATING_FUNC_t;
260 XMC_BCCU_CH_DIMMING_ENGINE_BYPASS_DISABLE = 0U,
261 XMC_BCCU_CH_DIMMING_ENGINE_BYPASS_ENABLE = 1U,
262 } XMC_BCCU_CH_DIMMING_ENGINE_BYPASS_t;
268 XMC_BCCU_CH_ACTIVE_LEVEL_HIGH = 0U,
269 XMC_BCCU_CH_ACTIVE_LEVEL_LOW = 1U,
270 } XMC_BCCU_CH_ACTIVE_LEVEL_t;
277 XMC_BCCU_CH_TRIG_EDGE_PASS_TO_ACT = 0U,
278 XMC_BCCU_CH_TRIG_EDGE_ACT_TO_PASS = 1U,
279 } XMC_BCCU_CH_TRIG_EDGE_t;
286 XMC_BCCU_CH_TRAP_INA = 0x0U,
287 XMC_BCCU_CH_TRAP_INB = 0x1U,
288 XMC_BCCU_CH_TRAP_INC = 0x2U,
289 XMC_BCCU_CH_TRAP_IND = 0x3U,
290 XMC_BCCU_CH_TRAP_INE = 0x4U,
291 XMC_BCCU_CH_TRAP_INF = 0x5U,
292 XMC_BCCU_CH_TRAP_ING = 0x6U,
293 XMC_BCCU_CH_TRAP_INH = 0x7U,
294 XMC_BCCU_CH_TRAP_INI = 0x8U,
295 XMC_BCCU_CH_TRAP_INJ = 0x9U,
296 XMC_BCCU_CH_TRAP_INK = 0xAU,
297 XMC_BCCU_CH_TRAP_INL = 0xBU,
298 XMC_BCCU_CH_TRAP_INM = 0xCU,
299 XMC_BCCU_CH_TRAP_INN = 0xDU,
300 XMC_BCCU_CH_TRAP_INO = 0xEU,
301 XMC_BCCU_CH_TRAP_INP = 0xFU,
302 } XMC_BCCU_CH_TRAP_IN_t;
309 XMC_BCCU_CH_TRAP_EDGE_RISING = 0U,
310 XMC_BCCU_CH_TRAP_EDGE_FALLING = 1U
311 } XMC_BCCU_CH_TRAP_EDGE_t;
317 XMC_BCCU_CH_TRIGOUT0 = 0U,
318 XMC_BCCU_CH_TRIGOUT1 = 1U,
319 } XMC_BCCU_CH_TRIGOUT_t;
325 XMC_BCCU_CH_DIMMING_SOURCE_GLOBAL = 7U,
326 XMC_BCCU_CH_DIMMING_SOURCE_DE0 = 0U,
327 XMC_BCCU_CH_DIMMING_SOURCE_DE1 = 1U,
328 XMC_BCCU_CH_DIMMING_SOURCE_DE2 = 2U,
329 } XMC_BCCU_CH_DIMMING_SOURCE_t;
335 XMC_BCCU_DIM_CURVE_COARSE = 0U,
337 XMC_BCCU_DIM_CURVE_FINE = 1U,
338 } XMC_BCCU_DIM_CURVE_t;
359 #if defined(__CC_ARM) 362 #elif defined(__TASKING__) 369 typedef struct XMC_BCCU_GLOBAL_CONFIG
373 uint32_t trig_mode:1;
375 uint32_t trig_delay:2;
378 uint32_t maxzero_at_output:12;
391 uint32_t global_dimlevel;
392 } XMC_BCCU_GLOBAL_CONFIG_t;
398 typedef struct XMC_BCCU_TRIG_CONFIG
400 XMC_BCCU_TRIGMODE_t mode;
401 XMC_BCCU_TRIGDELAY_t
delay;
404 uint16_t mask_trig_lines;
405 } XMC_BCCU_TRIG_CONFIG_t;
411 typedef struct XMC_BCCU_CH_CONFIG
413 uint32_t pack_thresh:3;
416 uint32_t dim_bypass:1;
418 uint32_t flick_wd_en:1;
419 uint32_t trig_edge:1;
420 uint32_t force_trig_en:1;
422 uint32_t pack_offcmp_lev:8;
424 uint32_t pack_oncmp_lev:8;
426 uint32_t pack_offcnt_val:8;
428 uint32_t pack_oncnt_val:8;
430 }XMC_BCCU_CH_CONFIG_t;
433 typedef struct XMC_BCCU_CH_CONFIG
437 uint32_t pack_thresh:3;
441 uint32_t dim_bypass:1;
443 uint32_t flick_wd_en:1;
444 uint32_t trig_edge:1;
445 uint32_t force_trig_en:1;
452 uint32_t pack_offcmp_lev:8;
455 uint32_t pack_oncmp_lev:8;
462 uint32_t pack_offcnt_val:8;
465 uint32_t pack_oncnt_val:8;
470 }XMC_BCCU_CH_CONFIG_t;
476 typedef struct XMC_BCCU_DIM_CONFIG
480 uint32_t dither_en:1;
483 }XMC_BCCU_DIM_CONFIG_t;
486 typedef struct XMC_BCCU_DIM_CONFIG
493 uint32_t dither_en:1;
499 }XMC_BCCU_DIM_CONFIG_t;
502 #if defined(__CC_ARM) 504 #elif defined(__TASKING__) 505 #pragma warning restore 530 void XMC_BCCU_GlobalInit (XMC_BCCU_t *
const bccu,
const XMC_BCCU_GLOBAL_CONFIG_t *
const config);
551 void XMC_BCCU_ConfigGlobalTrigger(XMC_BCCU_t *
const bccu, XMC_BCCU_TRIGMODE_t mode, XMC_BCCU_TRIGDELAY_t
delay);
567 __STATIC_INLINE uint32_t XMC_BCCU_ReadGlobalTrigger (XMC_BCCU_t *
const bccu)
587 void XMC_BCCU_SelectTrapInput (XMC_BCCU_t *
const bccu, XMC_BCCU_CH_TRAP_IN_t input);
603 __STATIC_INLINE uint32_t XMC_BCCU_ReadTrapInput (XMC_BCCU_t *
const bccu)
622 void XMC_BCCU_SetTrapEdge (XMC_BCCU_t *
const bccu, XMC_BCCU_CH_TRAP_EDGE_t edge);
638 __STATIC_INLINE uint32_t XMC_BCCU_ReadTrapEdge (XMC_BCCU_t *
const bccu)
657 void XMC_BCCU_ConfigSuspendMode (XMC_BCCU_t *
const bccu, XMC_BCCU_SUSPEND_MODE_t mode);
674 __STATIC_INLINE uint32_t XMC_BCCU_ReadSuspendMode (XMC_BCCU_t *
const bccu)
693 __STATIC_INLINE uint32_t XMC_BCCU_ReadLastTrigChanNr (XMC_BCCU_t *
const bccu)
712 void XMC_BCCU_SetFlickerWDThreshold (XMC_BCCU_t *
const bccu, uint32_t threshold_no);
726 __STATIC_INLINE uint32_t XMC_BCCU_ReadFlickerWDThreshold (XMC_BCCU_t *
const bccu)
744 void XMC_BCCU_SetFastClockPrescaler (XMC_BCCU_t *
const bccu, uint32_t div);
758 __STATIC_INLINE uint32_t XMC_BCCU_ReadFastClock (XMC_BCCU_t *
const bccu)
776 void XMC_BCCU_SetDimClockPrescaler (XMC_BCCU_t *
const bccu, uint32_t div);
790 __STATIC_INLINE uint32_t XMC_BCCU_ReadDimClock (XMC_BCCU_t *
const bccu)
808 void XMC_BCCU_SelectBitClock (XMC_BCCU_t *
const bccu, XMC_BCCU_BCLK_MODE_t div);
824 __STATIC_INLINE uint32_t XMC_BCCU_ReadBitClock (XMC_BCCU_t *
const bccu)
847 void XMC_BCCU_ConcurrentEnableChannels (XMC_BCCU_t *
const bccu, uint32_t mask);
867 void XMC_BCCU_ConcurrentDisableChannels (XMC_BCCU_t *
const bccu, uint32_t mask);
889 void XMC_BCCU_ConcurrentSetOutputPassiveLevel(XMC_BCCU_t *
const bccu, uint32_t chan_mask, XMC_BCCU_CH_ACTIVE_LEVEL_t level);
909 void XMC_BCCU_ConcurrentEnableTrap (XMC_BCCU_t *
const bccu, uint32_t mask);
929 void XMC_BCCU_ConcurrentDisableTrap (XMC_BCCU_t *
const bccu, uint32_t mask);
946 void XMC_BCCU_ConcurrentConfigTrigger (XMC_BCCU_t *
const bccu, XMC_BCCU_TRIG_CONFIG_t *trig);
967 void XMC_BCCU_ConcurrentStartLinearWalk (XMC_BCCU_t *
const bccu, uint32_t mask);
988 void XMC_BCCU_ConcurrentAbortLinearWalk (XMC_BCCU_t *
const bccu, uint32_t mask);
1008 void XMC_BCCU_ConcurrentEnableDimmingEngine (XMC_BCCU_t *
const bccu, uint32_t mask);
1028 void XMC_BCCU_ConcurrentDisableDimmingEngine (XMC_BCCU_t *
const bccu, uint32_t mask);
1049 void XMC_BCCU_ConcurrentStartDimming (XMC_BCCU_t *
const bccu, uint32_t mask);
1070 void XMC_BCCU_ConcurrentAbortDimming (XMC_BCCU_t *
const bccu, uint32_t mask);
1086 void XMC_BCCU_SetGlobalDimmingLevel (XMC_BCCU_t *
const bccu, uint32_t level);
1104 __STATIC_INLINE void XMC_BCCU_EnableInterrupt (XMC_BCCU_t *
const bccu, uint32_t event)
1106 bccu->EVIER |= event;
1125 __STATIC_INLINE void XMC_BCCU_DisableInterrupt (XMC_BCCU_t *
const bccu, uint32_t event)
1127 bccu->EVIER &= (uint32_t)~(event);
1142 __STATIC_INLINE uint32_t XMC_BCCU_ReadEventFlag (XMC_BCCU_t *
const bccu)
1144 return (bccu->EVFR);
1164 __STATIC_INLINE void XMC_BCCU_SetEventFlag (XMC_BCCU_t *
const bccu, uint32_t flag_type)
1166 bccu->EVFSR = flag_type;
1187 __STATIC_INLINE void XMC_BCCU_ClearEventFlag (XMC_BCCU_t *
const bccu, uint32_t flag_type)
1189 bccu->EVFCR = flag_type;
1205 void XMC_BCCU_EnableChannel (XMC_BCCU_t *
const bccu, uint32_t chan_no);
1220 void XMC_BCCU_DisableChannel (XMC_BCCU_t *
const bccu, uint32_t chan_no);
1237 void XMC_BCCU_SetOutputPassiveLevel(XMC_BCCU_t *
const bccu, uint32_t chan_no, XMC_BCCU_CH_ACTIVE_LEVEL_t level);
1252 void XMC_BCCU_EnableTrap (XMC_BCCU_t *
const bccu, uint32_t chan_no);
1267 void XMC_BCCU_DisableTrap (XMC_BCCU_t *
const bccu, uint32_t chan_no);
1284 void XMC_BCCU_EnableChannelTrigger (XMC_BCCU_t *
const bccu, uint32_t chan_no, XMC_BCCU_CH_TRIGOUT_t trig_line);
1299 void XMC_BCCU_DisableChannelTrigger (XMC_BCCU_t *
const bccu, uint32_t chan_no);
1317 void XMC_BCCU_CH_Init (XMC_BCCU_CH_t *
const channel,
const XMC_BCCU_CH_CONFIG_t *
const config);
1336 void XMC_BCCU_CH_ConfigTrigger (XMC_BCCU_CH_t *
const channel, XMC_BCCU_CH_TRIG_EDGE_t edge, uint32_t force_trig_en);
1353 __STATIC_INLINE void XMC_BCCU_StartLinearWalk (XMC_BCCU_t *
const bccu, uint32_t chan_no)
1372 __STATIC_INLINE void XMC_BCCU_AbortLinearWalk (XMC_BCCU_t *
const bccu, uint32_t chan_no)
1390 __STATIC_INLINE uint32_t XMC_BCCU_GetChannelOutputLvlAtLastTrigger (XMC_BCCU_t *
const bccu, uint32_t chan_no)
1392 return (uint32_t)((bccu->LTCHOL & (BCCU_LTCHOL_LTOL0_Msk << chan_no)) >> chan_no);
1406 void XMC_BCCU_CH_SetLinearWalkPrescaler (XMC_BCCU_CH_t *
const channel, uint32_t clk_div);
1420 __STATIC_INLINE uint32_t XMC_BCCU_IsLinearWalkComplete (XMC_BCCU_t *
const bccu, uint32_t chan_no)
1422 return (uint32_t)((bccu->CHSTRCON & (BCCU_CHSTRCON_CH0S_Msk << chan_no)) >> chan_no);
1439 void XMC_BCCU_CH_SetTargetIntensity (XMC_BCCU_CH_t *
const channel, uint32_t ch_int);
1452 uint32_t XMC_BCCU_CH_ReadIntensity (XMC_BCCU_CH_t *
const channel);
1474 void XMC_BCCU_CH_EnablePacker (XMC_BCCU_CH_t *
const channel, uint32_t thresh, uint32_t off_comp, uint32_t on_comp);
1489 void XMC_BCCU_CH_SetPackerThreshold (XMC_BCCU_CH_t *
const channel, uint32_t val);
1506 void XMC_BCCU_CH_SetPackerOffCompare (XMC_BCCU_CH_t *
const channel, uint32_t level);
1523 void XMC_BCCU_CH_SetPackerOnCompare (XMC_BCCU_CH_t *
const channel, uint32_t level);
1536 __STATIC_INLINE uint32_t XMC_BCCU_CH_ReadPackerThreshold (XMC_BCCU_CH_t *
const channel)
1553 __STATIC_INLINE uint32_t XMC_BCCU_CH_ReadPackerOffCompare (XMC_BCCU_CH_t *
const channel)
1570 __STATIC_INLINE uint32_t XMC_BCCU_CH_ReadPackerOnCompare (XMC_BCCU_CH_t *
const channel)
1587 void XMC_BCCU_CH_DisablePacker (XMC_BCCU_CH_t *
const channel);
1604 void XMC_BCCU_CH_SetPackerOffCounter (XMC_BCCU_CH_t *
const channel, uint32_t cnt_val);
1621 void XMC_BCCU_CH_SetPackerOnCounter (XMC_BCCU_CH_t *
const channel, uint32_t cnt_val);
1636 void XMC_BCCU_CH_SelectDimEngine (XMC_BCCU_CH_t *
const channel, XMC_BCCU_CH_DIMMING_SOURCE_t sel);
1650 void XMC_BCCU_CH_EnableDimmingBypass (XMC_BCCU_CH_t *
const channel);
1664 void XMC_BCCU_CH_DisableDimmingBypass (XMC_BCCU_CH_t *
const channel);
1679 __STATIC_INLINE void XMC_BCCU_CH_EnableGating (XMC_BCCU_CH_t *
const channel)
1697 __STATIC_INLINE void XMC_BCCU_CH_DisableGating (XMC_BCCU_CH_t *
const channel)
1716 __STATIC_INLINE void XMC_BCCU_CH_EnableFlickerWatchdog (XMC_BCCU_CH_t *
const channel)
1735 __STATIC_INLINE void XMC_BCCU_CH_DisableFlickerWatchdog (XMC_BCCU_CH_t *
const channel)
1754 void XMC_BCCU_DIM_Init (XMC_BCCU_DIM_t *
const dim_engine,
const XMC_BCCU_DIM_CONFIG_t *
const config);
1769 __STATIC_INLINE void XMC_BCCU_EnableDimmingEngine (XMC_BCCU_t *
const bccu, uint32_t dim_no)
1787 __STATIC_INLINE void XMC_BCCU_DisableDimmingEngine (XMC_BCCU_t *
const bccu, uint32_t dim_no)
1806 __STATIC_INLINE void XMC_BCCU_StartDimming (XMC_BCCU_t *
const bccu, uint32_t dim_no)
1825 __STATIC_INLINE void XMC_BCCU_AbortDimming (XMC_BCCU_t *
const bccu, uint32_t dim_no)
1843 __STATIC_INLINE uint32_t XMC_BCCU_IsDimmingFinished (XMC_BCCU_t *
const bccu, uint32_t dim_no)
1845 return (uint32_t)((bccu->DESTRCON & (BCCU_DESTRCON_DE0S_Msk << dim_no)) >> dim_no);
1863 void XMC_BCCU_DIM_SetTargetDimmingLevel (XMC_BCCU_DIM_t *
const dim_engine, uint32_t level);
1876 __STATIC_INLINE uint32_t XMC_BCCU_DIM_ReadDimmingLevel (XMC_BCCU_DIM_t *
const dim_engine)
1895 void XMC_BCCU_DIM_SetDimDivider (XMC_BCCU_DIM_t *
const dim_engine, uint32_t div);
1908 __STATIC_INLINE uint32_t XMC_BCCU_DIM_ReadDimDivider(XMC_BCCU_DIM_t *
const dim_engine)
1928 void XMC_BCCU_DIM_ConfigDimCurve (XMC_BCCU_DIM_t *
const dim_engine, uint32_t dither_en, XMC_BCCU_DIM_CURVE_t sel);
1941 __STATIC_INLINE XMC_BCCU_DIM_CURVE_t XMC_BCCU_DIM_GetDimCurve (XMC_BCCU_DIM_t *
const dim_engine)
1957 __STATIC_INLINE uint32_t XMC_BCCU_IsDitherEnable(XMC_BCCU_DIM_t *
const dim_engine)
#define BCCU_CH_PKCMP_ONCMP_Msk
#define BCCU_GLOBCON_WDMBN_Msk
#define BCCU_GLOBCLK_DCLK_PS_Msk
#define BCCU_DE_DTT_CSEL_Pos
#define BCCU_GLOBCON_TRAPIS_Msk
#define BCCU_GLOBCON_LTRS_Msk
#define BCCU_CHSTRCON_CH0S_Msk
#define BCCU_CH_CHCONFIG_WEN_Msk
#define BCCU_DE_DTT_DTEN_Pos
#define BCCU_DE_DTT_DTEN_Msk
#define BCCU_GLOBCON_SUSCFG_Msk
#define BCCU_DE_DTT_CSEL_Msk
#define BCCU_CH_CHCONFIG_PKTH_Msk
#define BCCU_DE_DTT_DIMDIV_Msk
#define BCCU_DEEN_EDE0_Msk
#define BCCU_GLOBCLK_FCLK_PS_Msk
#define BCCU_GLOBCON_TRAPED_Msk
#define BCCU_DESTRCON_DE0S_Msk
#define BCCU_GLOBCLK_FCLK_PS_Pos
#define BCCU_CHSTRCON_CH0A_Msk
#define BCCU_GLOBCON_TM_Msk
#define BCCU_CH_CHCONFIG_GEN_Msk
#define BCCU_GLOBCON_TRAPED_Pos
#define BCCU_DE_DL_DLEV_Msk
#define BCCU_CH_PKCMP_ONCMP_Pos
#define BCCU_GLOBCON_WDMBN_Pos
#define BCCU_GLOBCON_SUSCFG_Pos
#define BCCU_GLOBCON_LTRS_Pos
#define BCCU_GLOBCLK_BCS_Msk
#define BCCU_DESTRCON_DE0A_Msk
#define BCCU_GLOBCLK_DCLK_PS_Pos
#define BCCU_GLOBCLK_BCS_Pos
#define BCCU_GLOBCON_TRAPIS_Pos
#define BCCU_CH_PKCMP_OFFCMP_Msk
static void delay(uint32_t cycles)